package com.baidu.Chapter02;

import java.util.Scanner;

public class ex2_2 {
    public static void main(String[] args) {
        double r,h;
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter the radius and length of a cylinder：");
        r = sc.nextDouble();
        h = sc.nextDouble();
        double area = r*r* Math.PI;
        double volume = area * h;
        System.out.println("The area is "+ String.format("%.4f",area));
        System.out.println("The volume is "+ String.format("%.1f",volume));

    }
}
